﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mime;
using System.Runtime.Remoting.Contexts;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace ledinghuo.website
{
    public class BaseController:Controller
    {
        protected new ActionResult View()
        {
            if (!string.IsNullOrEmpty(Request.Headers["ApplicationType"]))
            {
                return Json(null);
            }
            return base.View();
        }

        protected new ActionResult View(IView view){
            if (!string.IsNullOrEmpty(Request.Headers["ApplicationType"]))
            {
                return Json(null);
            }
            return base.View(view);
        }

        protected new ActionResult View(object model){
            if (!string.IsNullOrEmpty(Request.Headers["ApplicationType"]))
            {
                return Json(model);
            }
            return base.View(model);
        }

        protected new ActionResult View(string viewName){
            if (!string.IsNullOrEmpty(Request.Headers["ApplicationType"]))
            {
                return Json(null);
            }
            return base.View(viewName);
        }

        protected new ActionResult View(IView view, object model)
        {
            if (!string.IsNullOrEmpty(Request.Headers["ApplicationType"]))
            {
                return Json(model);
            }
            return base.View(view, model);
        }

        
        protected new ActionResult View(string viewName, object model){
            if (!string.IsNullOrEmpty(Request.Headers["ApplicationType"]))
            {
                return Json(model);
            }
            return base.View(viewName,model);
        }
        
        protected new ActionResult View(string viewName, string masterName){
            if (!string.IsNullOrEmpty(Request.Headers["ApplicationType"]))
            {
                return Json(null);
            }
            return base.View(viewName,masterName);
        }
        protected new ActionResult View(string viewName, string masterName, object model){
            if (!string.IsNullOrEmpty(Request.Headers["ApplicationType"]))
            {
                return Json(model);
            }
            return base.View(viewName,masterName,model);
        }
    }
}
